package com.supinfo.suptracking.service;

import com.supinfo.suptracking.dao.CarDao;
import com.supinfo.suptracking.entity.Car;
import com.supinfo.suptracking.entity.User;
import com.supinfo.suptracking.entity.Zone;
import java.util.Date;
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateless;

/**
 *
 * @author Fabien, Jérémy, Ludovic, Brice
 */

@Stateless
public class CarService {
    
    @EJB
    private CarDao carDao;
    
    public void processAddCar(Car car) {
        carDao.addCar(car);
    }
    
    public void processDelCar(Car car){
        carDao.delCar(car);
    }
    
    public void processDelCar(long id){
        carDao.delCar(id);
    }
    
    public void processUpdateCar(Car car){
        carDao.updateCar(car);
    }
    
    public List<Car> processGetAllCar(){
        return carDao.getAllCar();
    }
    
    public List<Car> processGetCarByBrand(String brand){
        return carDao.getCarByBrand(brand);
    }
    
    public List<Car> processGetCarByInitialEntryIntoService(Date date){
        return carDao.getCarByInitialEntryIntoService(date);
    }
    
    public List<Car> processGetAllCarByUser(User user){
        return carDao.getAllCarByUser(user);
    }
    
    public Car processGetCarByZone(Zone zone){
        return carDao.getCarByZone(zone);
    }
    
    public Car processGetCarById(Long id){
        return carDao.getCarById(id);
    }
}
